<template>
	<view class="page-container">
		<use-navbar ref="navbar" :show="true" :back="true" :bg-color="navbarBgcolor" title="添加新课程"> </use-navbar>
		<!-- #ifdef MP-WEIXIN || MP-BAIDU -->
		<web-view src="http://mcda.youerp.cn/web/test/index.html" bindmessage="receiveMessage"></web-view>
		<!-- #endif -->
		<!-- #ifdef H5 -->
		<web-view style="position: fixed;top:0;left: 0;width: 100vw;height: 100vh;" src="./../../static/index.html"
			full-screen ref="unityWindows" @message="getMessage"></web-view>
		<!-- #endif -->
	</view>
</template>

<script setup>
	// --组合式 API 模板
	import {
		ref,
		onMounted
	} from 'vue'
	import {
		onLoad,
		onShow,
	} from "@dcloudio/uni-app";

	const navbarBgcolor = ref('rgba(red, green, blue, 0)')
	const title = ref("标题")
	const unityWebUrl = ref('http://mcda.youerp.cn/web/test/index.html')
	// onLoad 接受 A 页面传递的参数
	onLoad((option) => {
		console.log("B 页面 onLoad:", option); //B 页面 onLoad: {id: '1', name: 'uniapp'}

	});

	onShow(() => {
		console.log("B 页面 onShow");

	});
	onMounted(() => {

	})
	const getMessage = (event) => {
		console.log("我是谁：")
		console.log("我是谁：", event);
	}
</script>

<style lang="less" scoped>
	.canvas-box {
		width: 100vw;
		height: 85vh;
		position: fixed;
		top: 00;
		left: 0;

		#firstCanvas {
			width: 100%;
			height: 100%;
		}
	}

	.use-navbar {
		background-color: #fff;
	}
</style>